package psxt.tool;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;


import com.hc.core.Constants;

public class SystemTool {
	/**
	 * 获得当前用户id
	 * 
	 * @return
	 *
	public static String getCurrentUserId(HttpServletRequest request) {
		Hc_sys_user user = (Hc_sys_user) request.getSession(false)
				.getAttribute(Constants.SESSION_USER);
		return null != user ? user.getUserId() : null;
	}

	/**
	 * 获得当前用户名称
	 * 
	 * @return
	 *
	public static String getCurrentUserName(HttpServletRequest request) {
		Hc_sys_user user = (Hc_sys_user) request.getSession(false)
				.getAttribute(Constants.SESSION_USER);
		return null != user ? user.getUserName() : null;
	}

	/**
	 * 获得用户数据权限
	 * 
	 * @param request
	 * @return
	 *
	public static String getCurrentUserDataPerm(HttpServletRequest request) {
		Hc_sys_user user = (Hc_sys_user) request.getSession(false)
				.getAttribute(Constants.SESSION_USER);
		// return null != user ? user.getDataPerm() : null;

		return "90,80";
	}

	public static List getCurrentUserDepDataPerm(HttpServletRequest request) {

		List depList = new ArrayList();
		Code_xs codexs;
		codexs = new Code_xs();
		codexs.setXsh("90");
		codexs.setXsjc("电气学院");
		depList.add(codexs);
		codexs = new Code_xs();
		codexs.setXsh("80");
		codexs.setXsjc("计算机学院");
		depList.add(codexs);
		return depList;
	}
	*/
}
